package net.googlecode.exigenlab.Task3.workers;

/**
 * Creator of basic class Person
 *
 * @author Vitalii Myshenko <a href="mailto:vitalii.myshenko@gmail.com">
 *
 * @since 29.03.11
 */
public class Person {
    private String firstName;//first name of worker
    private String lastName;//last name of worker
    private int age;//age of worker
    protected double rate;//specifies monthly rate of worker
    protected boolean perHour;//specifies schedule
    protected boolean bonus;//specifies existence of bonus
    protected double bonusAmount;//specifies bonus amount
    private String position;//specifies working position of person

    /**
     * Constructor creates instance of person class
     *
     * @param firstName first name of worker
     * @param lastName  last name of worker
     */
    public Person(String firstName, String lastName) {
        this.firstName = firstName;
        this.lastName = lastName;
        this.perHour = true;
        this.bonus = true;
    }

    /**
     * Get full name of the worker
     *
     * @return first last name
     */
    public String getName() {
        return firstName + " " + lastName;
    }

    /**
     * Set age of worker
     *
     * @param age age of worker
     */
    public void setAge(int age) {
        this.age = age;
    }

    /**
     * Get age of worker
     *
     * @return age of worker
     */
    public int getAge() {
        return age;
    }

    /**
     * Set amount of worker's bonus
     *
     * @param bonusAmount amount of bonus
     */
    public void setBonusAmount(double bonusAmount) {
        this.bonusAmount = bonusAmount;
    }

    /**
     * Get amount of worker's bonus
     *
     * @return amount of bonus
     */
    public double getBonusAmount() {
        return bonusAmount;
    }

    /**
     * Set monthly or hour rate of worker
     *
     * @param rate value of rate
     */
    public void setRate(double rate) {
        this.rate = rate;
    }

    /**
     * Get monthly or hour rate of worker
     *
     * @return value of rate
     */
    public double getRate() {
        return rate;
    }

    /**
     * Set worker's position
     *
     * @param position name of occupied position
     */
    public void setPosition(String position) {
        this.position = position;
    }

    /**
     * Get worker's position
     *
     * @return name of occupied position
     */
    public String getPosition() {
        return position;
    }

    /**
     * Check the type of schedule
     *
     * @return true if hourly paid, false if fixed rate
     */
    public boolean isPerHour() {
        return perHour;
    }

    /**
     * Check if bonus available
     *
     * @return true if bonus available, false if there is no bonus available
     */
    public boolean isBonus() {
        return bonus;
    }

    /**
     * Set the type of schedule
     *
     * @param perHour set true if hourly rate, false if fixed rate
     */
    public void setPerHour(boolean perHour) {
        this.perHour = perHour;
    }

    /**
     * Set bonus
     *
     * @param bonus true if bonus available, false if there is no bonus available
     */
    public void setBonus(boolean bonus) {
        this.bonus = bonus;
    }


}
